package com.xps.charmingshop.date.servicrapi;


import com.xps.charmingshop.bean.BillBean;
import com.xps.charmingshop.bean.ClassificationBean;
import com.xps.charmingshop.bean.CompleteBean;
import com.xps.charmingshop.bean.ConductBean;
import com.xps.charmingshop.bean.LoginBean;
import com.xps.charmingshop.bean.MenuBean;
import com.xps.charmingshop.bean.ObtainMenuBean;
import com.xps.charmingshop.bean.OrderDetailsBean;
import com.xps.charmingshop.bean.RegisterBean;
import com.xps.charmingshop.bean.ShopBean;
import com.xps.charmingshop.bean.UpdateMenuBean;
import com.xps.charmingshop.bean.UpdateMenuInformationBean;
import com.xps.charmingshop.bean.VerificationBean;

import java.util.List;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

public interface UserApi {


    /**
     * 注册接口
     *
     * @param shop_register_way     注册方式,1:Facebook;2:KAKAO;3:微信;4:邮箱
     * @param shop_email            邮箱
     * @param shop_name             店铺名称
     * @param shop_sort_id          店铺所属分类
     * @param shop_branch           店铺分店名称
     * @param shop_main             店铺主营
     * @param shop_pass1            密码1
     * @param shop_pass2            密码2
     * @param shop_tel              电话号码
     * @param shop_avatar           头像
     * @param shop_business_license 营业执照
     * @param shop_province         所在省份
     * @param shop_city             所在城市
     * @param shop_address          详细地址
     * @param shop_x                经度
     * @param shop_y                维度
     * @param sms_code              验证码
     * @return
     */
    @FormUrlEncoded
    @POST("shop_registered/index")
    Observable<RegisterBean> getRegister(@Field("shop_register_way") String shop_register_way, @Field("shop_avatar") String shop_avatar, @Field("shop_email") String shop_email, @Field("shop_name") String shop_name, @Field("shop_sort_id") String shop_sort_id, @Field("shop_branch") String shop_branch, @Field("shop_main") String shop_main, @Field("shop_pass1") String shop_pass1, @Field("shop_pass2") String shop_pass2, @Field("shop_tel") String shop_tel, @Field("sms_code") String sms_code, @Field("shop_business_license") String shop_business_license, @Field("shop_province") String shop_province, @Field("shop_city") String shop_city, @Field("shop_address") String shop_address, @Field("shop_x") String shop_x, @Field("shop_y") String shop_y);

    /**
     * 注册验证码接口
     *
     * @param shop_tel 手机号
     * @return
     */
    @FormUrlEncoded
    @POST("shop_registered/send_message")
    Observable<VerificationBean> getVerification(@Field("shop_tel") String shop_tel);

    /**
     * 注册验证码接口
     *
     * @param shop_email    邮箱
     * @param shop_password 密码
     * @return
     */
    @FormUrlEncoded
    @POST("shop_registered/shop_login")
    Observable<LoginBean> getLogin(@Field("shop_email") String shop_email, @Field("shop_password") String shop_password);


    /**
     * 店铺信息接口
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop/shop_info")
    Observable<ShopBean> getShop(@Field("shop_token") String shop_token);

    /**
     * 店铺分类列表接口
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("main_shop_list/cate_gory_list")
    Observable<ClassificationBean> getClassification(@Field("shop_token") String shop_token);

    /**
     * 店铺信息更新接口
     *
     * @param shop_token      店铺token
     * @param shop_name       店铺名称
     * @param shop_status     店铺状态(1:正常;2:不公开)
     * @param shop_open_time  营业时间(早)
     * @param shop_close_time 闭店时间(晚)
     * @param shop_address    详细地址
     * @param shop_x          经度
     * @param shop_y          维度
     * @return
     */
    @FormUrlEncoded
    @POST("shop/shop_info_update")
    Observable<VerificationBean> getUpdateShop(@Field("shop_token") String shop_token, @Field("shop_name") String shop_name, @Field("shop_status") String shop_status, @Field("shop_open_time") String shop_open_time, @Field("shop_close_time") String shop_close_time, @Field("shop_address") String shop_address, @Field("shop_x") String shop_x, @Field("shop_y") String shop_y);

    /**
     * 我的菜单列表接口
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop/shop_dish")
    Observable<MenuBean> getMenu(@Field("shop_token") String shop_token);


    /**
     * 菜品详情接口
     *
     * @param shop_token 店铺token
     * @param shop_token 菜品id
     * @return
     */
    @FormUrlEncoded
    @POST("shop/dish_edit")
    Observable<UpdateMenuBean> getUpdateMenu(@Field("shop_token") String shop_token, @Field("dish_id") String dish_id);


    /**
     * 菜品修改接口
     *
     * @param shop_token    店铺token
     * @param dish_must
     * @param dish_optional @return
     */
    @FormUrlEncoded
    @POST("shop/dish_edit_post")
    Observable<UpdateMenuInformationBean> getUpdateMenuInformation(@Field("shop_token") String shop_token, @Field("dish_id") String dish_id, @Field("dish_name") String dish_name, @Field("dish_sort_id") String dish_sort_id, @Field("dish_price") String dish_price, @Field("dish_discount_price") String dish_discount_price, @Field("dish_pic_src") String dish_pic_src, @Field("dish_description") String dish_description, @Field("dish_must") String dish_must, @Field("dish_optional") String dish_optional);

    /**
     * 订单列表接口
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop_order/order_list")
    Observable<ConductBean> getOrder(@Field("shop_token") String shop_token);

    /**
     * 我的菜单列表接口
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop_order/order_list")
    Observable<CompleteBean> getComplete(@Field("shop_token") String shop_token, @Field("order_status") String order_status);

    /**
     * 查看订单详情
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop_order/order_details")
    Observable<OrderDetailsBean> getOrderDetails(@Field("shop_token") String shop_token, @Field("order_id") String order_id);

    /**
     * 更新菜品出菜时间
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop_order/change_order_status")
    Observable<VerificationBean> getUpdateDate(@Field("shop_token") String shop_token, @Field("order_id") String order_id, @Field("goods_ready_time") String goods_ready_time);

    /**
     * 我的菜单列表接口
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop/dish_sort")
    Observable<ObtainMenuBean> getAddObtainMenu(@Field("shop_token") String shop_token);

    /**
     * 我的菜单列表接口
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop/dish_add_post")
    Observable<VerificationBean> getAddMenu(@Field("shop_token") String shop_token, @Field("dish_name") String dish_name, @Field("dish_sort_id") String dish_sort_id, @Field("dish_price") String dish_price, @Field("dish_discount_price") String dish_discount_price, @Field("dish_pic_src") String dish_pic_src, @Field("dish_description") String dish_description, @Field("dish_must") String dish_must, @Field("dish_optional") String dish_optional);

    /**
     * 我的菜单列表接口
     *
     * @param shop_token 店铺token
     * @return
     */
    @FormUrlEncoded
    @POST("shop/dish_sort_add")
    Observable<VerificationBean> getAddClassification(@Field("shop_token") String shop_token, @Field("sort_name") String sort_name, @Field("sort_description") String sort_description);

    @FormUrlEncoded
    @POST("shop_order/my_bills")
    Observable<BillBean> getBill(@Field("shop_token") String shop_token);

}